//
//  HMNetworkTools.h
//  MyMicroBlog
//
//  Created by Apple on 16/9/26.
//  Copyright © 2016年 Apple. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"

//appKey
static NSString *WeiBoAppKey = @"2607220998";
//授权回调页
static NSString *WeiBoRedirect_URI = @"http://www.itcast.cn";
//appSecret
static NSString *WeiboAppSecret = @"bd8a9cb991b2f19c480cc3eef74e2843";

//网络请求类型
typedef enum: NSInteger {
    GET,
    POST
}requestType;
@interface HMNetworkTools : AFHTTPSessionManager
//全局单例
+(instancetype)sharedTools;
//封装请求
-(void)requestWithType:(requestType)type andUrl:(NSString *)url andParams:(id)params andCallBack:(void(^)(id response, NSError *error))callBack;
@end

//OAuth登录接口
@interface HMNetworkTools (Request)
//根据code获取accessToken
-(void)requestAccessTokenWithCode: (NSString *)code andCallBack:(void(^)(id,NSError *))callBack;

@end
